/*
 * DungeonEventResource.h
 *
 *  Created on: 2013. 9. 10.
 *      Author: mega@gamevil.com
 */

#ifndef DUNGEONEVENTRESOURCE_H_
#define DUNGEONEVENTRESOURCE_H_

#include <map>

namespace ProjectZ { namespace NResource {

class DungeonEventData
{
public:
	struct Flyweight
	{
		int _DUNGEON_ID;
		int _EXP_1;
		int _DROP_1;
		int _GOLD_1;
		int _EXP_2;
		int _DROP_2;
		int _GOLD_2;
		int _EXP_3;
		int _DROP_3;
		int _GOLD_3;
		int _EXP_4;
		int _DROP_4;
		int _GOLD_4;
		int _EXP_5;
		int _DROP_5;
		int _GOLD_5;
		int _EXP_6;
		int _DROP_6;
		int _GOLD_6;
		int _EXP_7;
		int _DROP_7;
		int _GOLD_7;
	};

public:
	DungeonEventData() {}
	virtual ~DungeonEventData();

	bool LoadResource(int company, int saleCode);
	Flyweight * GetFly(int dungeonID);

private:
	void	Clear();

private:
	typedef std::map<int, Flyweight *>	DATATREE;
	DATATREE	clsFlyTree;
};


class DungeonEventResource
{
public:
	DungeonEventResource();
	virtual ~DungeonEventResource();

	bool LoadResource();
	DungeonEventData::Flyweight * GetFly(User * pUser, int dungeonID);

	int			GetWeightDropRate(User * pUser);
	int			GetWeightGold(User * pUser);
	int			GetWeightExp(User * pUser);

private:
	DungeonEventData * pDungeonEventAD;
	DungeonEventData * pDungeonEventIOS;
};

} /*NResource*/ } /* namespace ProjectZ */


#endif /* DUNGEONEVENTRESOURCE_H_ */
